package com.rd.student.jiaji.class3.caiyuxin.java7_31;

public class RonNum2 {
    public static void main(String[] args) {
        int[] sum = new int[20];
        int count = 0;
        while (count < 20) {
            int a = (int) (Math.random() * 50);
            for (int i = 0; i < sum.length; i++) {

                  if (a == sum[i]) {
                      break;
                }
                 else {
                     sum[count]=a;
                    System.out.println("添加了" + sum[count]);
                    count++;
                    break;
                }


            }
        }
            for (int i = 0; i < sum.length; i++) {
                System.out.print(sum[i] + " ");
            }



    }}
